import Vue from 'vue'
import App from './App.vue'
// 引入路由
import router from '@/router'
// 注册全局组件TypeNav
// 引入Vuex管理仓库
import store from '@/store/index'
import TypeNav from '@/components/TypeNav'
import Carousel from '@/components/Carousel'
import Pagination from '@/components/pagination'
import * as API from '@/api'
import { MessageBox } from 'element-ui'
console.log(API)

// 引入mock
import '@/mock/mockServe'
import 'swiper/css/swiper.css'
Vue.component(TypeNav.name, TypeNav)
Vue.component(Carousel.name, Carousel)
Vue.component(Pagination.name, Pagination)

Vue.prototype.$msgbox = MessageBox
Vue.prototype.$alert = MessageBox.alert
Vue.config.productionTip = false

new Vue({
    beforeCreate() {
        Vue.prototype.$bus = this
        Vue.prototype.$API = API
    },
    router,
    store,
    API,
    render: h => h(App)
}).$mount('#app')